package pers.fjl.test.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import pers.fjl.common.po.Permission;
import pers.fjl.common.vo.PermissionVo;

import java.util.List;

@Repository
public interface PermissionDao extends BaseMapper<Permission> {
    /**
     * 通过中间表获取角色拥有的对应列表关系
     * @param rid
     * @return list
     */
    @Select("SELECT o.id, auth_name, pid, path , rid " +
            "FROM permission p,own o " +
            "WHERE o.id = p.id AND rid =#{rid} ")
    List<Permission> getOwn(Integer rid);
}
